import { get, post } from '@/utils/http'
import apiConfig from '@/config/api'
import moment from 'moment'

export const getUserList = async () => {
  let ret = await get(apiConfig.users)
  if (ret.code == 0) {
    let data = ret.data.map(item => ({
      ...item,
      at: moment().format('YYYY-MM-DD')
    }))
    return data
  }
  return false
}

export const loginApi = userInfo => post(apiConfig.login, userInfo)